#include <stdio.h>
#include <string.h>

int main() {
    char str[60];
    while(fgets(str, sizeof(str), stdin)) {
        int len=strlen(str);
        if (str[len - 1] == '\n') { 
            str[len - 1] = '\0';
        } 
        int nums=(len+1)/2;
        int sum=0;
        int flag=1;
        //{"ABCD"}
        int arr[4]={4,3,2,1};
        for (int i=0;i<len;i+=2) {
            if(str[i]<='D' && str[i]>='A'){
                sum += arr[str[i]-'A'];
            }
            else if(str[i]=='F'){
                sum += 0;
            }
            else{
                printf("Unknown\n");
                flag=0;
                break;
            }
        }
        if(flag){
            printf("%.2f\n",((double)sum)/nums);    
        }
    }
    return 0;
}